Page({

    /**
     * 页面的初始数据
     */
    data: {
      img: [
        "/images/imagesZJK/homeTab_lb1.jpg",
        "/images/imagesZJK/homeTab_lb2.jpg",
        "/images/imagesZJK/homeTab_lb3.jpg"
      ],
    },
    
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {

    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    },


    sclass: function () {
      wx.navigateTo({
        url: '/pages/profileTab/mycourse/mycourse?title=navigate',
      })
    },

  //显示对话框
  showModal: function (event) {
    var i = event.currentTarget.dataset.id;
    // 显示遮罩层
    var animation = wx.createAnimation({
      duration: 200,
      timingFunction: "linear",
      delay: 0
    })
    this.animation = animation
    animation.translateY(300).step()
    if(i==0){
      this.setData({
        animationData0: animation.export(),
        showModalStatus0: true
      })
      setTimeout(function () {
        animation.translateY(0).step()
        this.setData({
          animationData0: animation.export()
        })
      }.bind(this), 200)
    }else if(i==1){
      this.setData({
        animationData1: animation.export(),
        showModalStatus1: true
      })
      setTimeout(function () {
        animation.translateY(0).step()
        this.setData({
          animationData1: animation.export()
        })
      }.bind(this), 200)
    };
    wx.hideTabBar({
      aniamtion: true,
    });
  },

  //隐藏对话框
  hideModal: function (event) {
    var i = event.currentTarget.dataset.id;
    // 隐藏遮罩层
    var animation = wx.createAnimation({
      duration: 200,
      timingFunction: "linear",
      delay: 0
    })
    this.animation = animation
    animation.translateY(300).step()
    if(i==0){
      this.setData({
        animationData0: animation.export(),
      })
      setTimeout(function () {
        animation.translateY(0).step()
        this.setData({
          animationData0: animation.export(),
          showModalStatus0: false
        })
      }.bind(this), 200)
    }else if(i==1){
      this.setData({
        animationData1: animation.export(),
      })
      setTimeout(function () {
        animation.translateY(0).step()
        this.setData({
          animationData1: animation.export(),
          showModalStatus1: false
        })
      }.bind(this), 200)
    };
    wx.showTabBar({
      aniamtion: true,
    });
  },

  mate: function (event) {
    var that = this;
    var id = event.currentTarget.dataset.id;
    wx.navigateTo({
      url: 'mate/mate?id='+id,
    })
  }

})